/*
package com.vvitt.kotlinhiltcarhome.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.paging.LoadState
import com.vvitt.kotlinhiltcarhome.R
import com.vvitt.kotlinhiltcarhome.adapter.CarBrandAdapter
import com.vvitt.kotlinhiltcarhome.databinding.ActivityMainBinding
import com.vvitt.kotlinhiltcarhome.viewmodel.CarBrandViewModel
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.collectLatest

*/
/**
 * @author please call me police uncel
 * @since 2023/5/26
 * @email 110
 * @desciption MainActivity
 **//*

@AndroidEntryPoint
class MainActivity1 : AppCompatActivity() {

    private val mBinding : ActivityMainBinding by lazy {
        ActivityMainBinding.inflate(layoutInflater)
    }
    private val viewModel by viewModels<CarBrandViewModel>()
    private val mAdapter by lazy { CarBrandAdapter(this) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(mBinding.root)

        mBinding.recyleView.adapter = mAdapter
        viewModel.data.observe(this,{
            mAdapter?.submitData(lifecycle,it)
        })

        lifecycleScope.launchWhenCreated {
            mAdapter?.loadStateFlow?.collectLatest { state ->
                mBinding.swiperRefresh.isRefreshing = state.refresh is LoadState.Loading

            }
        }
    }
}*/
